#include "Floor.h"

Floor::Floor(GLShaderManager* shaderManager, GLGeometryTransform& transformPipeline, GLBatch floorBatch)
:ThreeDObject(shaderManager, transformPipeline) {
	this->lines = floorBatch;
	fillInBlue();
	fillBatch();
}
void Floor::apearOnScreen() {
	this->shaderManager->UseStockShader(GLT_SHADER_FLAT,
		this->transformPipeline.GetModelViewProjectionMatrix(),
		this->color);
	this->lines.Draw();
}
void Floor::fillBatch() {
	lines.Begin(GL_LINES, 324);
	for(GLfloat x = -20.0; x <= 20.0f; x+= 0.5) {
		lines.Vertex3f(x, -0.55f, 20.0f);
		lines.Vertex3f(x, -0.55f, -20.0f);

		lines.Vertex3f(20.0f, -0.55f, x);
		lines.Vertex3f(-20.0f, -0.55f, x);
	}
	lines.End();
}
void Floor::fillInBlue() {
	color[0] = 0.0f;
	color[1] = 0.0f;
	color[2] = 1.0f;
	color[3] = 1.0f;
}
